package Menus;

import java.awt.Color;
import java.awt.Graphics;
import FrameWork.Menu;
import FrameWork.Utilities;
import Main.SpaceGame;

public class AnnouncementMenu extends Menu
{
	int pixXPos = 0;
	int pixYPos = SpaceGame.windowYSize-100;
	int width = SpaceGame.windowXSize;
	int height = 100;
	int level = 0;
	boolean cursorRequirement = false;
	SpaceGame main;
	public AnnouncementMenu(SpaceGame main) 
	{
		this.main = main;
	}

	public void draw(Graphics g)
	{
		g.translate(pixXPos, pixYPos);
		
		g.setColor(Color.LIGHT_GRAY);
		g.fillRect(0, 0, width, height);
		g.setColor(Color.DARK_GRAY);
		g.fillRect(5, 5, width-10, height-10);
		
		if (main.announcementManager.announcementList.size() < 5)
		{
			for (int i = 0;i<main.announcementManager.announcementList.size();i++)
			{
				g.setColor(main.announcementManager.announcementList.get(i).getColor());
				g.drawString(main.announcementManager.announcementList.get(i).getText(), 15, Utilities.textInterval*(i+1)+8);
			}
		}
		else
		{
			int cnt = 0;
			for (int i = main.announcementManager.announcementList.size()-5;i<main.announcementManager.announcementList.size();i++)
			{
				cnt++;
				g.setColor(main.announcementManager.announcementList.get(i).getColor());
				g.drawString(main.announcementManager.announcementList.get(i).getText(), 15, Utilities.textInterval*(cnt)+8);
			}
		}
		
		g.translate(-pixXPos, -pixYPos);
	}

	@Override
	public int getLevel() 
	{
		return level;
	}
	
	@Override
	public boolean requiresCursor() 
	{
		return cursorRequirement;
	}

	@Override
	public void setRequiresCursor(boolean f)
	{
		this.cursorRequirement = f;
	}
}
